<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:sec="http://www.similarworld.com/security/tag"
	template="/WEB-INF/templates/template.xhtml">
	<ui:define name="content">
		<h:form>

			<p:dataList value="#{homeBean.items}" var="item" type="definition">

				<f:facet name="description">
					<p:panel>
					<h:panelGrid columns="2">
			    		<h:outputText value="Caption: #{item.caption}, Description: #{item.description}" /> 
			    		<p:rating value="#{item.rate}" stars="10" readonly="#{!sec:isAuthenticated()}">
			    			<p:ajax event="rate" listener="#{homeBean.rate}"/> 
			    		</p:rating>
					  <p:graphicImage url="http://media2.ntvmsnbc.com/i/NTVMSNBC/Components/ArtAndPhoto-Fronts/SectionsThumbnails-TSM-Colorbox/_Cover/130121_sneijders.jpg" />
						<h:link value="Detay" outcome="/item.xhtml?item_id=#{item.id}" ></h:link>
					</h:panelGrid>
					</p:panel>
				</f:facet>
			</p:dataList>

		</h:form>

	</ui:define>
</ui:composition>
